﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ITAP.Core.Modelling;


namespace ITAP.ContourBuilder.Components
{
    [Serializable]
    public class ContourElementHook : ContourConnector
    {
        private ContourElement element;
        private double offset;
        private ContourElementPoints hookType;

        public ContourElementPoints HookType
        {
            get { return hookType; }
        }

        public override ModelPoint Position
        {
            get
            {
                return this.element.Primitive.GetPoint(offset);
            }
        }

        public override int RadiusInPixels
        {
            get
            {
                return GlobalData.HookRadiusInPixels;
            }
            set
            {
            }
        }

        public ContourElementHook(ContourElement element, double offset, ContourElementPoints hookType)
        {
            this.element = element;
            this.offset = offset;
            this.hookType = hookType;
        }

        public override void AcceptVisitor(IContourVisitor visitor)
        {
            visitor.Visit(this);
        }

        public override int Id
        {
            get
            {
                return -1;
            }
            set
            {
            }
        }
    }
}
